There is an increase in demand for nonvolatile memory devices, such as semiconductor memory cards, having rewritable nonvolatile memories. In general, semiconductor memory cards are more expensive than optical disks, tape media and other similar media. Semiconductor memory cards, however, have many advantages such as small-size, lightweight, earthquake-proof, and easy to use. Therefore, the demand for semiconductor memory cards has been increasing as recording media for mobile devices such as digital still cameras and mobile phones. Also, semiconductor memory devices are recently being used as recording media for moving picture recorders for consumer use, moving picture recorders used in a broadcast station or for professional use, and other similar devices. In addition to these, not only portable devices, but also stationary devices such as digital TV sets or DVD recorders include slots for semiconductor memory cards as standard.
These types of semiconductor memory cards include a flash memory as a nonvolatile main memory and a memory controller for controlling the main memory. The memory controller controls the flash memory for reading or writing data in accordance with a read command and a write command received from an access device such as a digital still camera.
In recent years, there is an increase in demand for larger capacities for flash memories used for semiconductor memory cards. This is because semiconductor memories need to adapt to and store high quality AV contents including still images and moving images, each of which has a larger data size than before. As a result, the size of a block, which is a constituent of a flash memory and the unit by which data is erased, is increasing.
Furthermore, the access device uses a file system to control the memory area of a semiconductor memory card. In general, the unit used by the file system, which is called a “cluster”, has a smaller size than the above-mentioned block so that the memory area can be used with as little unused area as possible. Therefore, when a single cluster is to be rewritten, the whole block needs to be rewritten, which significantly slows down the data writing. One known memory controller holds down frequent writings to the whole block and prevents the data writing from slowing down, as described in Patent Citation 1.
According to this known technique, plural blocks, each of which is the unit for erasing data, are divided into a first block group, a second block group, and a spare block group. When first blocks included in the first block group are requested to be written to but found to be filled up with data so that additional data cannot be written thereto, second blocks included in the second block group are used as extended blocks of the first blocks. In this case, only the updated pieces of the data stored in the first blocks are written to the second blocks. When all the second blocks are then filled up and no more data can be added, spare blocks in the spare block group are used such that only valid data of the first and second blocks are organized and written to the spare blocks, and then the original data in the first and second blocks from which the data has been copied into the spare blocks is erased to change the first and second blocks into new spare blocks and unoccupied second blocks respectively. This decreases the number of times for rewriting the whole block and prevents the data writing from slowing down.    Patent Citation 1: JP2001-154909